package com.xinyue.game.client;

import com.xinyue.network.hamdlermapping.GameHandlerMappingService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

import javax.annotation.PostConstruct;

/**
 * @author 王广帅
 * @date 2021年01月27日 10:50 下午
 */
@SpringBootApplication
public class GameClientShellMain {
    private Logger logger;
    @Autowired
    private ApplicationContext context;
    @Autowired
    private GameHandlerMappingService gameHandlerMappingService;

    public static void main(String[] args) {
        SpringApplication.run(GameClientShellMain.class, args);
    }

    @PostConstruct
    public void init() {
        logger = LoggerFactory.getLogger(GameClientShellMain.class);
        logger.info("--->开始初始化客户端");
        gameHandlerMappingService.scanGameHandler(context);
    }
}
